const numbers = [10, 20, 30, 40, 50];
let target = 30;

for (let i = 0; i < numbers.length; i++) {
	if (numbers[i] === target) {
		console.log(`找到目标值 ${target}，索引为 ${i}`);
		break; // 找到后立即跳出整个循环
	}
	console.log(`当前值：${numbers[i]}（未找到目标）`);
}